spiisolator9 2.2.2
Loading...
Searching...
No Matches
main.c File Reference

SPI Isolator 9 Click example. More...

#include "board.h"
#include "log.h"
#include "spiisolator9.h"

Macros

#define MIKROBUS_POSITION_SPIISOLATOR9   MIKROBUS_1
#define DEVICE_NAME   "Accel 22 Click"
#define DEVICE_SPI_READ_REG   0x0B
#define DEVICE_REG_ID   0x00
#define DEVICE_ID   0xAD

Functions

void spiisolator9_get_accel22_id (spiisolator9_t *ctx)
 SPI Isolator 9 get accel 22 id function.
void application_init (void)
void application_task (void)
int main (void)

Detailed Description

SPI Isolator 9 Click example.

Description

This example demonstrates the use of SPI Isolator 9 Click board by reading the device ID of the connected Accel 22 Click board.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger.

Application Task

Reads and checks the device ID of the connected Accel 22 Click board, and displays the results on the USB UART approximately once per second.

Note
Make sure to provide a VCC power supply on the VOUT side.
Author
Stefan Filipovic

Macro Definition Documentation

◆ DEVICE_ID

#define DEVICE_ID   0xAD

◆ DEVICE_NAME

#define DEVICE_NAME   "Accel 22 Click"

◆ DEVICE_REG_ID

#define DEVICE_REG_ID   0x00

◆ DEVICE_SPI_READ_REG

#define DEVICE_SPI_READ_REG   0x0B

◆ MIKROBUS_POSITION_SPIISOLATOR9

#define MIKROBUS_POSITION_SPIISOLATOR9   MIKROBUS_1

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )

◆ spiisolator9_get_accel22_id()

void spiisolator9_get_accel22_id ( spiisolator9_t * ctx)

SPI Isolator 9 get accel 22 id function.

This function reads and checks the device ID of the connected Accel 22 Click board.

Parameters
[in]ctx: Click context object. See spiisolator9_t object definition for detailed explanation.
Returns
None.
Note
None.